package cn.ekuma.epos.pda;

import java.awt.Component;

import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.data.ui.swing.SwingEditorRecord;
import cn.ekuma.epos.datalogic.I_DataLogicERP;
import cn.ekuma.epos.module.ERP_UI_Swing_Model;
import cn.ekuma.epos.panel.JPanelTableDAO;

import com.openbravo.bean.pda.LocalHistory;
import com.openbravo.data.basic.BasicException;
import com.openbravo.pos.model.AbstractPosSwingModel;

public class JLocalHistoryUploadPanel extends JPanelTableDAO<LocalHistory>{

	@Override
	public String getTitle() {
		return "PDA上传资料库";
	}

	private I_DataLogicERP m_dlSales;
    private JLocalHistoryEditor jeditor;
    @Override
    protected void init() {
        jeditor=new JLocalHistoryEditor(this.dirty);
    }

    @Override
    public void activate() throws BasicException {
        jeditor.activate();
        super.activate();
    }

    @Override
    public SwingEditorRecord getEditor() {
        return jeditor;
    }

	@Override
	public Component getFilter() {
		return null;
	}

	@Override
	public I_DataLogic getDataLogic() {
		return m_dlSales;
	}

	@Override
	public Class getSuportClass() {
		return LocalHistory.class;
	}

	@Override
	public String getObjectRenderString(LocalHistory obj) {
		return obj.getLocalMachineName()+":"+obj.getId();
	}

	@Override
	public String getModelName() {
		return ERP_UI_Swing_Model.MODEL_NAME;
	}

	@Override
	public void setModel(AbstractPosSwingModel mode) {
		m_dlSales = mode.getDLERP();
		
	}

}
